home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15639 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  799 b 

  1. Path: news.cc.sunysb.edu!usenet
  2. From: dkat@psych1.psy.sunysb.edu (DK)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is wrong with this loop?
  5. Date: Sat, 20 Apr 1996 20:34:36 GMT
  6. Organization: State University of New York at Stony Brook
  7. Message-ID: <4lb6sj$c5c@abel.cc.sunysb.edu>
  8. References: <4l86la$1t9@uwm.edu> <4l8apa$kv8@spanky.pls.ov.com>
  9. NNTP-Posting-Host: as3-14.noc080.sunysb.edu
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12.  
  13. /* I assume you mean 
  14.   while (cd != 'm' || cd != 'f' || cd != 'o')
  15. /*try using gets(line) - it is always safer*/
  16.  
  17. while(gets(line)!=NULL)
  18.    cd = line[0];
  19.     if(cd != 'm' || cd != 'f' || cd != 'o')
  20.       printf("Re-enter m, f, or o.\n"); 
  21. }
  22. /* I'm assuming you're only looking at the first char of a line -
  23. otherwise just bump through line - i'm guessing at your goal*/
  24.  
  25.